package com.lagou.zookeeperweb;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ZookeeperwebApplication {

    public static void main(String[] args) {
        SpringApplication.run(ZookeeperwebApplication.class, args);

                ZkConfigMag mag = new ZkConfigMag();
                Config config = mag.downLoadConfigFromDB();
                System.out.println("....加载数据库配置...."+config.toString());
                mag.syncConfigToZk();
                System.out.println("....同步配置文件到zookeeper....");

                //歇会，这样看比较清晰
                try {
                    Thread.sleep(10000);
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                mag.upLoadConfigToDB("cwhcc", "passwordcc");
                System.out.println("....修改配置文件...."+config.toString());
                mag.syncConfigToZk();
                System.out.println("....同步配置文件到zookeeper....");


            }

        }



